#include<iostream>
#include<string>
using namespace std;

class drink{
public:
	virtual void zhushui() = 0;
	virtual void chongpao() = 0;
	virtual void daoru() = 0;
	virtual void jialiao() = 0;
	void dodrink(){
		zhushui();
		chongpao();
		daoru();
		jialiao();

	}
};
class coffee:public drink{
public:
	void zhushui(){
		cout<<"boil water"<<endl;
	}
	void chongpao(){
		cout<<"brew coffee"<<endl;
	}
	void daoru(){
		cout<<"pour into the cup"<<endl;
	}
	void jialiao(){
		cout<<"add suger and milk"<<endl;
	}
};
class tea:public drink{
public:
	void zhushui(){
		cout<<"boil water"<<endl;
	}
	void chongpao(){
		cout<<"brew tea"<<endl;
	}
	void daoru(){
		cout<<"pour into the cup"<<endl;
	}
	void jialiao(){
		cout<<"add lemon"<<endl;
	}

};

void makedrink(drink * d){
	d->dodrink();
	delete d;
}

void test01(){
	makedrink(new coffee);
	cout<<"+++++++++++++++++++++++++++++++++++"<<endl;
	makedrink(new tea);
}
int main(){
	test01();
	return 0;
}

	

